Next | Prev | Up | Top | Contents | Index

Device Controls

Device controls are string values that are passed via an IOCTL message to the STREAMS module for an input device at the time the device is opened. You can use device controls as a way of configuring the device module at runtime. Device controls are interpreted only by the module.

X init controls have the same syntax as device controls, but are processed by the X server after the device has been initialized.


Where Controls Are Stored

You can issue X server device controls on the fly by calling XSGIDeviceControl from within a program, or by storing them in configuration files in the /usr/lib/X11/input/config directory. Specific documentation on controls can be found in /usr/lib/X11/input/config/README.

There are (potentially) two configuration files per device. As noted under "Opening Input Devices", the X server looks for device controls in a file with the same name as the STREAMS module that implements the device. After the module returns the X name of the device, the X server looks for X init controls in a file with the X name of the device.

Some devices use the same name for the STREAMS module and for the X device (tablet, mouse), but some use different names for the two. For example, the STREAMS module for the Spaceball device is sball, while the X name is spaceball.

The X server intercepts about a dozen x_init controls. For a list of the x_init controls and some of the more common device_init controls, see the file


Control Syntax

When the X server opens a file to look for device controls, it searches the file for a single set of controls with the following format:

device_init {
   name   "value"
   ...
}
Each name may have at most 15 characters. Each value may have at most 23 characters. Each pair of name and value are put in an IOCTL message of idevOtherControl type and sent down to the device module for interpretation.

When the X server opens a file to look for X init controls, it searches the file for a single set of controls with the following format:

x_init {
   name   "value"
   ...
}
The syntax is the same, except for the use of x_init instead of device_init.

The specific name and value strings that the X server supports are documented in the file /usr/lib/X11/input/config/README. Any name strings that are not recognized by the X server are sent down to the device module, just as if they were device controls.


Next | Prev | Up | Top | Contents | Index